import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';

//列表
export const columns: BasicColumn[] = [
  {
    title: '任务名称',
    align:"center",
    dataIndex: 'name'
  },
  {
    title: '所属流程',
    align:"center",
    dataIndex: 'processName'
  },
  {
    title: '委托人',
    align:"center",
    dataIndex: 'owner'
  },
  {
    title: '流程发起人',
    align:"center",
    dataIndex: 'applyer'
  },
  {
    title: '优先级',
    align:"center",
    dataIndex: 'priority',
    customRender:({text}) => {
      let arr=['普通','重要','紧急','无'];
      return arr[text];
    },
  },
  {
    title: '状态',
    align:"center",
    dataIndex: 'isSuspended',
    customRender:({text}) => {
      text=text==false?0:1;
      let arr=['已激活','已挂起'];
      return arr[text];
    },
  },
  {
    title: '创建时间',
    align:"center",
    dataIndex: 'createTime'
  },

];

//查询
export const searchFormSchema: FormSchema[] = [
  {
    label: '任务名称',
    field: 'name',
    component: 'Input',
    colProps: { span: 6 },
  },
];

//请假表单
export const formSchemaQJ: FormSchema[] = [
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '请假类型',
    field: 'name',
    component: 'Input',
  },
  {
    label: '请假事由',
    field: 'descc',
    component: 'InputTextArea',
  },
  {
    label: '年龄',
    field: 'age',
    component: 'InputNumber',
  },
  {
    label: '请假期间工作处理',
    field: 'chegnshi',
    component: 'InputTextArea',
  },
];
//请假表单
export const formSchemaTJ: FormSchema[] = [
  {
    label: '选择审批人',
    field: 'assignees',
    component: 'Select',
    defaultValue:'',
    componentProps: {
      placeholder:'选择审批人',
      options:[]
    }
  },
  {
    label: '优先级',
    field: 'priority',
    component: 'Select',
    defaultValue:'0',
    componentProps: {
     
      options: [
        {
          label: '普通',
          value: '0',
        },
        {
          label: '重要',
          value: '1',
        },
        {
          label: '紧急',
          value: '2',
        },
      ]
    },
  },
  {
    label: '消息通知',
    field: 'sendMessage',
    component: 'Select',
    defaultValue: true,
    componentProps: {
      options: [
        {
          label: '站内消息通知',
          value: true,
        },
      ]
    },
  },
];

export const formSchemaCancel: FormSchema[] = [
{
  label: '撤回原因',
  field: 'reason',
  component: 'InputTextArea',
},
];


//请假表单
export const searchHistoricFlowDetail: FormSchema[] = [
  {
    label: 'ce',
    field: 'procInstId',
    defaultValue:'1213',
    component: 'Input',
    show: false,
  },
]

//通过表单
export const spTGDetail: FormSchema[] = [
  {
    label: '审批意见',
    field: 'comment',
    defaultValue:'',
    component: 'InputTextArea',
  },
  {
    label: '消息通知',
    field: 'sendMessage',
    component: 'Select',
    defaultValue: true,
    componentProps: {
      options: [
        {
          label: '站内消息通知',
          value: true,
        },
      ]
    },
  },
]
//驳回
export const spBHDetail: FormSchema[] = [
  {
    label: '审批意见',
    field: 'comment',
    defaultValue:'',
    component: 'InputTextArea',
  },
  {
    label: '驳回至',
    field: 'backTaskKey',
    component: 'Select',
    defaultValue:'1',
    componentProps: {
      placeholder:'选择驳回节点',
      options:[]
    }
  },
  
  {
    label: '消息通知',
    field: 'sendMessage',
    component: 'Select',
    defaultValue: true,
    componentProps: {
      options: [
        {
          label: '站内消息通知',
          value: true,
        },
      ]
    },
  },
]
//委派
export const spWPDetail: FormSchema[] = [
  {
    label: '审批意见',
    field: 'comment',
    defaultValue:'',
    component: 'InputTextArea',
  },
  {
    label: '选择委托人',
    field: 'userId',
    component: 'JSelectUserByDept',
    componentProps: {
      labelKey: 'realname',
      rowKey: 'userId',
    },
  },
  
  {
    label: '消息通知',
    field: 'sendMessage',
    component: 'Select',
    defaultValue: true,
    componentProps: {
      options: [
        {
          label: '站内消息通知',
          value: true,
        },
      ]
    },
  },
]